home *** CD-ROM | disk | FTP | other *** search
/ Risc World 3 / Risc World 3.iso / SOFTWARE / ISSUE2 / FASTERPC / DRIVE_C / FDOS / XKEYB.TXT < prev    next >
Text File  |  2002-04-04  |  30KB  |  888 lines

  1. XKEYB - version 1.90. 
  2.  
  3. Keyboard driver for DOS. (AT machines)
  4.  
  5. XKEYB is Free Software. It is the FreeDOS' replacement for KEYB.COM/KEYB.EXE.
  6. It is released under the GNU GENERAL PUBLIC LICENSE, see the file
  7. COPYING.TXT for the full text. 
  8.  
  9. For more information about FreeDOS, go to the web site, 
  10. <http://www.freedos.org>.
  11.  
  12. XKEYB requires an AT-class keyboard, and at least a 286 CPU.
  13.  
  14. ------------------------------------------------------------
  15.  
  16. 1. Contents
  17. ===========
  18.  
  19. Contents                                         1
  20. What XKeyb is                                    2
  21. How XKeyb is used                                3
  22. The structure of the configuration file          4
  23. Improving Storage utilization with XKEYBRES      5
  24. The on-line documentation XKEYB.HLP              6
  25. PI - the Program Interface of XKeyb.             7
  26. Using PI with the unit XKeyb_PI                  8
  27. Using the macro recorder KeyMan                  9
  28. Version differences                             10
  29. Conditions of use                               11
  30. XKeyb files                                     12
  31. Keyboard layouts supported                      13
  32.  
  33.  
  34. 2. What XKeyb is
  35. ================
  36.  
  37. As the name suggests, XKeyb is a keyboard driver with a certain resemblance
  38. to the well-known KEYB.COM.
  39.  
  40. As with KEYB, XKeyb is also a keyboard driver for DOS-based computers, which is
  41. installed as a memory-resident program and can be configured for different
  42. countries using parameters. 
  43.  
  44. However XKeyb allows many more configuration options than Keyb. Thus, you can
  45. configure XKeyb not only for different countries, but also for your own
  46. personal preferences.
  47.  
  48. On the one hand XKeyb permits the free allocation of all keys on all levels
  49. (normally with SHIFT, CTRL, ALT, and CTRL-ALT), while on the other hand it
  50. offers the flexibility to define character strings to individual keys on
  51. certain levels.
  52.  
  53. Furthermore for each key it can be determined separately whether it is
  54. influenced by CAPS LOCK, NUM LOCK or SCROLL LOCK, and if the SHIFT, CTRL, and
  55. ALT keys determine what values are issued.
  56.  
  57. The programmer is provided with a PI (Program Interface) to XKeyb. It allows
  58. access to many of the XKeyb functions.
  59.  
  60.  
  61.  
  62. 3. How XKeyb is used 
  63. ====================
  64.  
  65. The general use of XKeyb is identical to that of KEYB.COM. The program is
  66. installed by using the command:
  67.  
  68. XKEYB <Configuration File> 
  69.  
  70. Standard configuration files are contained within MS-DOS for all countries,
  71. which are also used by KEYB.COM. The names of these files consists of the
  72. well-known "Country Code" and the extension KEY. Thus to install XKeyb for a
  73. German keyboard you would use the command:
  74.  
  75. XKEYB GR or XKEYB GR.KEY. 
  76.  
  77. In addition to the standard definitions XKeyb includes the file GR2.KEY. This
  78. file contains a definition for a German keyboard with geringfugigen and
  79. anderungen. Additionally the function of the CAPS LOCK key of SHIFT LOCK
  80. is geandert in a genuine Caps LOCK, which applies exclusively to the
  81. character keys.
  82.  
  83. These standard key assignment definitions are used to serve as a basis for
  84. non-standard adjustments. All manipulations of the key assignment made with
  85. XKeyb become additional definition files, which use the extension KEY. The
  86. use of other extensions must be explicitly indicated in the call to XKeyb.
  87.  
  88. These definition files are text files using a similar structure to that of
  89. Windows INI files. The exact structure is described in the next section. 
  90.  
  91. If the key allocation needs to be modified after XKeyb has been installed,
  92. then this is easily done by using a renewed call to XKeyb with another
  93. definition file specified (the resident copy of XKeyb is re-used).
  94.  
  95. One further note on Extension Strings ("XStrings"):
  96.  
  97. Under normal conditions XKeyb reserves only the minimum required amount of
  98. workspace for XStrings that is required for essential operations (rounded up
  99. to a full paragraph). If additional XStrings are to be created, then the /Xnn
  100. switch should be used to explicitly set the amount of storage space to be
  101. reserved for XStrings (where nn is the memory-size indicated in bytes).
  102.  
  103. e.g. To install XKeyb with 480 bytes workstation for XStrings and with German
  104.      key assignment, use this command:
  105.  
  106. XKEYB GR /X480 
  107.       or 
  108. XKEYB /X480 GR 
  109.  
  110. Two further switches are available when XKeyb is installed:
  111.  
  112. /U   (Uninstall), removes the resident copy from XKeyb from memory (if 
  113.       installed)
  114. /Q   (Quiet), suppresses the output of LIST paragraph in configuration
  115.       files (see the next section).
  116.  
  117.  
  118.  
  119. 4. The structure of a configuration file 
  120. ========================================
  121.  
  122. A configuration file for XKeyb is divided into several paragraphs, each of
  123. which contain a section of the entire keyboard definition. Thus the paragraph
  124. KEYS defines the actual key allocation, (i.e. which characters and if necessary
  125. which XStrings are situated on which key). Extension Strings are defined in
  126. the XSTRINGS paragraph. The SHIFT paragraph defines which keys functions are
  127. assigned to using SHIFT, CTRL and ALT. The COMBI paragraph is used to define
  128. combination characters (e.g. ^ + a = â). COMMENT and LIST paragraphs may be
  129. placed within other paragraphs wherever needed, and the paragraphs can appear
  130. in any sequence.
  131.  
  132. Any line starting with ; is considered a comment, and thus ignored, regardless of
  133. the section where it may appear.
  134.  
  135. The file GR2.KEY is a practical example for the structure of a definition file.
  136.  
  137. The following is a detailed description of the individual paragraphs: 
  138.  
  139.  
  140. [ KEYS ]
  141.  
  142. This paragraph contains one key definition per line. The line begins with
  143. the Scancode of the key, immediately followed by one or more of N, C or S
  144. This is use to indicate if the key should be influenced by NUM-, CAPS-, or
  145. SCROLL-LOCK.
  146.  
  147. The rest of the line is made up of a list of 5 key levels, which define the
  148. character to be output when the key is pressed by itself, or with SHIFT,
  149. CTRL, ALT and ALT Gr (in that order). These values should be separated by
  150. spaces. The values can be either the actual characters, or their ASCII codes
  151. preceded by a "#" character. An example line from GR2.KEY follows:
  152.  
  153.  72N #0 8 #26 #0 E
  154.  
  155. Characters with ASCII values less than 36 are always indicated using the "#"
  156. character.
  157.  
  158. A special scancode is allowed: E53, which stands for the gray / key, which is
  159. different to the key on the alphanumeric section reporting the same scancode.
  160. You will probably have to add this to your newly created .KEY files:
  161.  
  162.  E53 /  /  #0 #0 #0
  163.  
  164. Instead of a character, a decimal number followed by an exclamation mark can
  165. be used to assign an extension string or funciton to the key. The numbers 1-200
  166. are available for XStrings, while the values greater than 200 are reserved for
  167. special functions, as listed in the table below:
  168.  
  169. Value          Meaning
  170. -------  --------------------------------------------------------------------
  171. 201-240  Reserved for XFunctions (see the PI section for more information)
  172. 241-246  Reserved
  173. 247      OS/2 2.0: DOS box close. (ALT-F4)
  174. 248-249  Reserved
  175. 250      Umschalten on BIOS Tastaturtreiber (CTRL-ALT-F1)
  176. 251-253  Reserved
  177. 254      Print Screen (hardcopy)
  178. 255      System Reset (CTRL-ALT-DEL)
  179.  
  180.  
  181. [ SHIFTS ]
  182.  
  183. This paragraph is used to define the shift and lock keys. This is just a list
  184. of the key scancodes, spearated by spaces, in the following order:
  185.  
  186. SHIFT1 SHIFT2 CTRL ALT SCROLL NUM CAPS INSERT 
  187.  
  188.  
  189. [ XSTRINGS ]
  190.  
  191. This paragraph is used to define extension strings. The format is:
  192.  
  193. <Number> <String> 
  194.  
  195. Note that a space must be placed between the Number and the String. All
  196. characters (including spaces) after the first space are interpreted as
  197. part of the Extension String.
  198.  
  199. The Extension String is assigned to a key in the [ KEYS ] paragraph.
  200.  
  201. Valid numbers for XStrings are in the range 1-200. An example follows:
  202.  
  203. [XSTRINGS]
  204. 1 Dat is 'ne Schdring
  205. 2 DIR *.ABC | SORT | MORE\n
  206. 17 Mit freundlichen Grussen
  207. 123 \[DEL]\[CD]\[AF10]
  208.  
  209. As you can see inthe above example, various special characters can be used in
  210. XStrings, preceded by a "\" character. The available special characters are as
  211. follows:
  212.  
  213. Special              Value Produced
  214. -------  --------------------------------------
  215. \\       \
  216. \Axxx    Character with the ASCII value xxx
  217. \Sxxx    Key with the Scancode xxx
  218. \n       Carriage Return (equivalent to \A013)
  219. \[HOME]  HOME key
  220. \[END]   END key
  221. \[PU]    PAGE UP key
  222. \[PD]    PAGE DOWN key
  223. \[CL]    CURSOR LEFT key
  224. \[CR]    CURSOR RIGHT key
  225. \[CU]    CURSOR UP key
  226. \[CD]    CURSOR DOWN key
  227. \[DEL]   DEL key
  228. \[INS]   INS key
  229. \[Fx]    Function key #x 
  230. \[SFx]   SHIFT + Function key #x
  231. \[CFx]   CTRL + Function key #x
  232. \[AFx]   ALT + Function key #x
  233.  
  234. The HOME, END, PU, PD, CL and CR keys can be prededed with the leter "C"
  235. This corresponds to a press of the respective key while holding the CTRL key.
  236.  
  237.  
  238. [ COMBI ]
  239.  
  240. This paragraph is used to define combination characters.
  241. The first character of each line is the "combination character", and is followed
  242. by several pairs of characters. When XKeyb detects the "combination character"
  243. along with the first character of a character pair, it will output the second
  244. character of the pair.
  245.  
  246. Example: 
  247.  
  248. ' a  eŵ i¡ o¢ u£ #32'
  249.  
  250. the line above defines the following combination keys:
  251.  
  252. '+a= 
  253. '+e=ŵ
  254. '+i=¡
  255. '+o=¢
  256. '+u=£
  257. '+<SPACE>='
  258.  
  259. Non-printable characters are indicated by their ASCII value as the first
  260. character of a character pair.
  261.  
  262. The exclamation mark has a special function: It clears the existing definition
  263. for a group of combination characters:
  264.  
  265. ^! aâ 
  266.  
  267. This line clears all existing combination characters beginning with ^ and then
  268. defines the combination ^+a=â.
  269.  
  270.  
  271. [ CONTINUE ]
  272.  
  273. This paragraph contains only one line. It contains the name of another
  274. configuration file. If XKeyb finds this paragraph, the processing of the
  275. current configuration file is terminated, and the indicated configuration file
  276. is processed. This allows a concatenation of configuration files.
  277.  
  278.  
  279. [ COMMENT ]
  280.  
  281. These paragraphs are ignored by XKeyb, and are used to insert comments.
  282.  
  283.  
  284. [ LIST ]
  285.  
  286. XKeyb outputs the contents of these paragraphs to the screen, unless output
  287. is supressed by the /Q command-line switch.
  288.  
  289.  
  290.  
  291. 5. Improving Storage utilization with XKEYBRES
  292. ==============================================
  293. When installed under normal conditions the XKeyb program occupies less memory
  294. than the original MS-DOS keyboard driver. However because of the relatively
  295. large amount of memory necessary to load a configuration file, XKeyb must
  296. allocate far more memory than its DOS counterpart, which can make it difficult
  297. to load XKeyb into upper memory.
  298.  
  299. To avoid this problem the XKEYRES program was developed. It contains all of the
  300. components of the keyboard driver which remain resident, but only a minimum
  301. of initialisation routines. This program is substantially smaller than XKEYB
  302. and can be installed in a memory block as small as 10KB. The disadvantage of
  303. loading XKEYBRES is that it doesn't load a keyboard definition (i.e. all keys
  304. are undefined and produce no characters).  To prevent the keyboard from being
  305. blocked, the driver remains deactivated (in the same way as pressing
  306. ALT-CTRL-F1 will deactivate XKeyb).
  307.  
  308. After XKEYBRES has been installed a keyboard definition can be loaded using
  309. the command:
  310.  
  311. XKEYB <definition file>
  312.  
  313. This will also automatically switch the keyboard driver into active mode.
  314.  
  315. Two additional things should be considered before using XKEYBRES:
  316.  
  317. 1. The driver is installed as a memory resident program even if a keyboard
  318.    driver is already installed.
  319. 2. The size of the additional storage area for extension strings cannot be
  320.    defined for XKEYBRES (the /Xnn switch for XKeyb). XKEYBRES always reserves
  321.    923 bytes for extension character strings.
  322.  
  323. An example of using XKEYBRES as the keyboard driver could look like this in
  324. AUTOEXEC.BAT:
  325.  
  326. @Echo off
  327. ...
  328. LH XKEYBRES
  329. XKEYB GR /Q
  330. ...
  331.  
  332.  
  333.  
  334. 6. The on-line documentation XKEYB.HLP
  335. ======================================
  336.  
  337. Starting from version 1.5 of XKeyb the file XKEYB.HLP is included. This file
  338. contains the program documentation as a Windows 3.1 Help file.
  339.  
  340. To view the on-line documentation start the file XKEYB.HLP under Windows 3.1
  341. from either the File or Program manager.
  342.  
  343.  
  344.  
  345. 7. PI - the Program Interface of XKeyb. 
  346. ========================================
  347.  
  348. The Program Interface is an interface for other programs, allowing all of the
  349. XKeyb functions to be accessed. Apart from the functions relating to key 
  350. assignment, it also provides functions for extended keyboard inquiry and the
  351. definition of Hotkeys.
  352.  
  353. The PI is accessed using the multiplexer INTERRUPT (INT 2Fh). The AH register
  354. must contain the value ADh, and the AL register must have the number of the
  355. required function.
  356.  
  357. The functions of the PI and their applications in detail: 
  358.  
  359.  
  360. Installation CHECK (80h)
  361. This function allows the program to determine if XKeyb is resident in memory.
  362.  
  363. Input:  AX=AD80h 
  364.  
  365. Output: AL=00h -> No keyboard driver installed. 
  366.         AL=FFh, BX=584Bh -> XKeyb installed, CX=version number 
  367.         BX<>584Bh -> Other keyboard driver (probably KEYB.COM) 
  368.  
  369.  
  370. Set keyboard mapping (82h)
  371. This function switches between XKeyb and the BIOS keyboard driver.
  372. (CTRL-ALT-F1 / F2)
  373.  
  374. Input:  AX=AD82h
  375.         BL=00h -> BIOS keyboard driver
  376.         BL=FFh -> XKeyb
  377.  
  378. Output: CF=1 -> Error 
  379.         CF=0 -> OK 
  380.                   
  381. The 80h and 82h functions are also available with KEYB.COM, but the following
  382. functions only apply to XKeyb (starting from version 1.20).
  383.  
  384.  
  385. Set key translation (90h)
  386. This function sets the output(s) of an individual key (the same as a line in
  387. the [ KEYS ] paragraph of the definition file).
  388.  
  389. Input:  DI=key number (Scancode of the key) 
  390.         BL=Normal allocation 
  391.         CH=value with SHIFT 
  392.         CL=value with CTRL 
  393.         DH=value with ALT 
  394.         DL=value with ALTGr / CTRL+ALT 
  395.         BH=key status 
  396.  
  397. Output: AX=0 -> OK 
  398.         AX=4 -> Bad key number 
  399.  
  400. Note: The allocations are either ASCII values, those the key is to be assigned
  401.       directly, or the numbers of XStrings/XFunctions.
  402.  
  403. The meaning of the key status bits: 
  404. Bit    Meaning (if bit is set to 1)
  405. ---  ------------------------------------------------------------
  406.  0   key with SCROLL LOCK
  407.  1   key with NUM LOCK
  408.  2   key with CAPS LOCK 
  409.  3   key is on level 4 (AltGr/CTRL-ALT), and mapped to an XString
  410.  4   XString/XFunction on level 3 (ALT)
  411.  5   XStrinc/XFunction on level 2 (CTRL)
  412.  6   XString/XFunction on level 1 (SHIFT)
  413.  7   XString/XFunction on level 0 (without everything)
  414.  
  415.  
  416. Get key translation (91h)
  417. The query function for function 90h. 
  418.  
  419. Input:  AX=AD91h 
  420.         DI=key number (Scancode) 
  421.  
  422. Output: AX=0 -> OK. BX, CX, DX contain the allocations. 
  423.         AX=4 -> Bad key number. 
  424.  
  425.  
  426. Wait for key hit (94h)
  427. As the name implies, this function waits until a key is depressed. The
  428. contents of the key buffers are ignored.
  429.  
  430. Input:  AX=AD94h 
  431.  
  432. Output: AH=Virtual Scancode 
  433.         BH=Real Scancode 
  434.         AL=ASCII value 
  435.         BL=Key status 
  436.         DH=Key Level (0-4) 
  437.  
  438. Note: The presence of two Scancodes may appear somewhat confusing. The reason
  439.       is that some keys produce a different Scancode when used with certain
  440.       shift keys (the virtual Scancode). This is the case with the function
  441.       keys (F1-F10) and some of the cursor keys. With the alphanumeric keys
  442.       both Scancodes are the same.
  443.       BL contains the keyboard status from 0:417h and indicates the status of
  444.       the shift keys. DH indicates the key level, from which the ASCII value
  445.       originates.
  446.  
  447.  
  448. Put key into buffer (95h)
  449. This function stores a virtual 'key' in the keyboard buffer.
  450.  
  451. Input:  AX=AD95h 
  452.         BH=Scancode (virtual) 
  453.         BL=ASCII value 
  454.  
  455. Output: AX=0 -> OK 
  456.         AX=5 -> Buffer full 
  457.  
  458.  
  459. Set XString (96h)
  460. with set XString is geandert an extension stringer or again created.
  461.  
  462. Input:  AX=AD96h 
  463.         BL=XString number (1-200) 
  464.         ES:DI=Pointer to the string 
  465.  
  466. Output: AX=0 -> OK 
  467.         AX=1 -> Bad XString number 
  468.         AX=2 -> XString memory full 
  469.  
  470. Note: The first byte of the string must contain the string length (Pascal
  471.       string). Special characters (such as \n or \S072) are NOT interpreted.
  472.       If the XString is to contain keys which do not produce ASCII values
  473.       (like cursor and function keys), then these are indicated by a zero
  474.       byte followed by the virtual Scancode of the key in the string. The
  475.       allocation of the XString:
  476.  
  477.       'ABC\[F11]DEF\n'
  478.  
  479.       is thus achieved by the string:
  480.  
  481.       'ABC'#0#87'DEF'#13.
  482.  
  483.  
  484. GET XString (97h)
  485. The query function for function 96h.
  486.  
  487. Input:  AX=AD97h 
  488.         BL=XString number 
  489.         ES:DI=Address of Buffer for string 
  490.  
  491. Output: AX=0 -> OK. String is stored at ES:DI. 
  492.         AX=1 -> Bad XString number. 
  493.         AX=3 -> XString is not defined. 
  494.  
  495.  
  496. Set XFunction (98h)
  497. This function equivalent to function 96h, except that it defines XFunctions
  498. rather than XStrings.
  499.  
  500. As with XStrings, XFunctions are assigned to keys, and are assigned to
  501. numbers (XFunctions are reserved the numbers 201 to 240).
  502.  
  503. If a key is pressed which has an XFunction associated with it, one of 3
  504. things will happen:
  505. 1. The function is output immediately
  506. 2. The functionis output using INT16 (keyboard BIOS).
  507. 3. If the function is not output-driven a flag is set, which indicates
  508.    that the function was activated.
  509.  
  510. Input:  AX=AD98h 
  511.         BL=XFunction number (0=function code look up) 
  512.         BH=Call  Convention: 0=Output using INT16 
  513.                              1=Output immediately 
  514.                              2=Flag set 
  515.         ES:DI=Address of routine / flag 
  516.  
  517. Output: AX=0 -> OK. BL = function code. 
  518.         AX=1 -> Bad XFunction number 
  519.         AX=6 -> No function codes free 
  520.         AX=7 -> Invalid call convention 
  521.  
  522. Note: The indicated routine must be FAR. It receives as a parameter a Word,
  523.       which caontains Scancode of the key in its upper byte and
  524.       and the keyboard status in its lower byte. This allows the routine to
  525.       determine its caller, if it is called from several different keys.
  526.  
  527.       If BH contains the value 2, then the Word is stored with to activate
  528.       the function with ES:DI. Everything
  529.       else is then thing of the appropriate program. If the indicated routine
  530.       is output-driven immediately (BH=1), is not with the Ausfuhrung the
  531.       hardware INTERRUPTS yet again de-energised (the INTERRUPT CONTROLLER
  532.       has still no EoI received). Therefore the call convention 0 should be
  533.       preferred if moglich. Protecting the Ausfuhrung of the routine is all
  534.       ublichen INTERRUPTS certified. Within the routine it is to be made
  535.       certain that before an access to the own data segment the DS register
  536.       must be set accordingly. Furthermore it recommends to switch if
  537.       necessary to its own stack. Registers DS and BP are to contain the same
  538.       values during the jerk branch, as with the entrance. 
  539.  
  540.  
  541. Clear XFunction (99h)
  542. Clears an XFunction definition.
  543.  
  544. Input:  BL=Number of the XFunction (201-240) 
  545. Output: AX=0 -> OK 
  546.         AX=1 -> Invalid XFunction number 
  547.         AX=8 -> Indicated XFunction is not occupied 
  548.  
  549.  
  550. Set translation table address (9Ah)
  551. Sets the address of the keyboard Translation Table.
  552.  
  553. Input:  ES:DI=Address of the new table 
  554.  
  555. Output: AX=0 -> OK 
  556.  
  557. Note: This function allows the administration of several key assignments,
  558.       by switching the Translation Table. Each table consists of 100
  559.       entries, each of which consist of 5 levels of the allocations for and
  560.       the status byte as the last byte of the entry. If a new table is
  561.       selected with this function which is not initialized the keyboard will
  562.       produce random characters.
  563.  
  564.  
  565. Get translation table address (9Bh)
  566. Determines the address of the current Translation Table.
  567.  
  568. Input: AX=AD9Bh 
  569.  
  570. Output: ES:DI=Address of the Translation Table. 
  571.  
  572.  
  573. Get last XString (9Ch)
  574. Determines the number of the last defined XString.
  575.  
  576. Input: AX=AD9Ch 
  577.  
  578. Output: BL=Number of the last XString 
  579.  
  580.  
  581. GET combination table address (9Dh)
  582. Returns the address of the combination characters table.
  583.  
  584. The table has the following structure: 
  585.  
  586. 1st entry
  587.     first character of the combination (e.g. ')
  588.     number of following combinations (e.g. 2)
  589.         1st combination second character of the combination (e.g. a)
  590.             resulting character (e.g. ...)
  591.         2nd combination second character of the combination (e.g. i)
  592.             resulting character (e.g. ™)
  593. 2nd entry
  594. ...
  595.  
  596. A zero byte follows the last entry in the table.
  597.  
  598. The table can be a maximum of 192 bytes long, including the zero byte. 
  599.  
  600. Input:  AX=AD9Dh 
  601.  
  602. Output: ES:DI=Address of table. 
  603.  
  604.  
  605. Get shift table address (9Eh)
  606. Determines the address of the list with the Scancodes of the shift keys:
  607.  
  608. SHIFT1 SHIFT2 CTRL ALT SCROLL NUM CAPS INSERT 
  609.  
  610. Input: AX=AD9E 
  611.  
  612. Output: ES:DI=Address of table. 
  613.  
  614.  
  615.  
  616. 8. Using PI with the unit XKeyb_PI
  617. ==================================
  618.  
  619. XKeyb_PI is a Turbo Pascal unit which allows easy access to the functions
  620. of the Program Interface:
  621.  
  622. Function TestInstalled : Word;
  623.  
  624. Procedure XKeybOn(B : Boolean);
  625.  
  626. Procedure SetKey(KeyNum,Normal,Shift,Control,Alt,AltGr,Status);
  627.  
  628. Procedure GetKey(Num:Byte;Var Norm,Shift,Ctrl,Alt,AltGr,Status);
  629.  
  630. Procedure WaitForKey(Var VScan,RScan,Ascii,KeyStat,Ebene:Byte);
  631.  
  632. Procedure PutKey(Ascii,Scan : Byte);
  633.  
  634. Procedure SetXStr(Num : Byte; XStr : String);
  635.  
  636. Procedure GetXStr(Num : Byte; Var XStr : String);
  637.  
  638. Procedure SetXFunc(Var Num:Byte; CallConv:Byte; Adresse:Pointer);
  639.  
  640. Procedure ClearXFunc(Num : Byte);
  641.  
  642. Procedure SetTable(P : Pointer);
  643.  
  644. Function TableAdr : Pointer;
  645.  
  646. Function LastXStr : Byte;
  647.  
  648. Function CombiTabAdr : Pointer;
  649.  
  650. Function ShiftTabAdr : Pointer;
  651.  
  652. After reading the previous section the function of these routines should be
  653. reasonably clear. If not, the file XKeyb_PI.PAS contains further information.
  654.  
  655. At least one of the routines calling these functions must contain the variable
  656. FEHLER to receive the error status:
  657.  
  658. 0 = OK, otherwise error code (see XKeyb_PI.PAS and the PI section for more
  659.                               details)
  660.  
  661. In addition to these functions (which directly correspond to the functions
  662. of the Program Interface), two additional functions are provided: Enter and
  663. Leave. Both are to be used only within an XFunction routine. 
  664.  
  665. Enter saves the DS, SS and SP registers, loads DS with the address of the
  666. Turbo Pascal data segment, and adjusts SS:SP to the Turbo Pascal stack.
  667.  
  668. Leave sets SS:SP and DS to their old values. 
  669.  
  670. An XFunction routine could then resemble the following: 
  671.  
  672. Type   KeyTyp = Record
  673.                 Stat,Scan : Byte;
  674.                 End;
  675. {$F+}  { Routine must be FAR! }
  676. Procedure MyHotkey(Key : Keytyp);
  677. Begin
  678.    Enter;
  679.    DoIt(Key);
  680.    Leave;
  681. End;
  682. {$F-}
  683.  
  684. When using Enter and Leave the routine may use any global, however NO local
  685. variables. However this applies only to the XFunction routine. All of these
  686. called routines must define any variables they produce and use.
  687.  
  688.  
  689.  
  690. 9. Using the macro recorder KeyMan
  691. ==================================
  692.  
  693. Another program included with XKeyb is KEYMAN.EXE. KeyMan is a simple macro
  694. recorder which is installed as a memory resident program that allows simple
  695. (re)definition of keys.
  696.  
  697. KeyMan can only be loaded if XKeyb already is already resident in memory. It
  698. is activated by a Hotkey (F11 by default). After activation KeyMan will pop up
  699. a window on the display. Now you can either press a key to which you want to
  700. assign a new macro, or press the Hotkey again to redefine it.
  701.  
  702. If you pressed a key which already had a macro assigned to it, the current
  703. macro will be printed in the window. This macro can be edited by using the
  704. BACKSPACE key to erase the displayed keystrokes (to include a BACKSPACE
  705. keystroke as part of the macro, press ALT and "8" on the numeric keypad).
  706. After pressing the Hotkey again the macro will be allocated and the window
  707. wil disappear.
  708.  
  709. Note: If the key you pressed did NOT already have a macro assigned to it,
  710.       that key will be defaulted as the first keystroke of the macro
  711.       (i.e. if you pressed CTRL-D, the macro will initially consist of the
  712.       keystroke "CTRL-D").
  713.  
  714. If the new macro consisted of more than one character, an XString will be
  715. automatically created and assigned to the key (if enough XString space was
  716. allocated via the /Xnn switch when XKeyb was installed).
  717.  
  718. If you pressed the Hotkey after the activation of KeyMan, KeyMan will ask you
  719. to press the new Hotkey. After pressing a key the window will disappear and
  720. the key pressed will become the new Hotkey.
  721.  
  722. If you want to save an interactively created key allocation, then you can do
  723. this by using the command
  724.  
  725. LISTXDEF >xyz.KEY
  726.  
  727.  
  728.              
  729. 10. Version differences 
  730. =======================
  731.  
  732. Version 1.1: 
  733.  
  734. - Erganzt around Programming Interface. 
  735.  
  736. - New macro recorder KeyMan. 
  737.  
  738. Version 1.2: 
  739.  
  740. - Implementation of combination characters.
  741.  
  742. - Elimination of errors with call of the INT15h (interface for additional
  743.   keyboard drivers)
  744.  
  745. Version 1.22: 
  746.  
  747. - Function of Control+Break geandert in call of INT 1Bh and production of ^C. 
  748.  
  749. - Error correction: The combinations of keys ALT+1 to ALT+0 and ALT+ '
  750.   produce the correct virtual Scancodes starting from 1.22.
  751.  
  752. Version 1.24: 
  753.  
  754. - Special function 247: Call of INT 19h.
  755.   under DOS: Computer reboots (does not function on all systems)
  756.   under OS/2 2.0: DOS box close.
  757. - Elimination of errors: With the XStrings defined in the file GR2.KEY the
  758.   keys F11 and F12 supply the correct virtual Scancodes.
  759. - Documentation included as WinWord file. 
  760.  
  761. Version 1.3: 
  762.  
  763. - Errors with switching on BIOS keyboard driver recovered. 
  764. - Problem with non functioning backslash in the MS-DOS wordprocessor fixed
  765. - On computers with AMI BIOS memory test is ??? performed on warm start
  766. - Errors during automatic large adjustment of the storage area for XStrings
  767.   fixed
  768. - Extended keyboard status becomes, up to which bit unterstutzt for the right
  769.   CTRL key.
  770.  
  771. Version 1.5: 
  772.  
  773. - Improved ability to load the driver into UMBs by using XKEYBRES. 
  774.  
  775. Version 1.5e: (English language copy of v1.5 for FreeDos)
  776.  
  777. - All messages and documentation translated to English
  778. - Winword 2.0 documentation removed (this is Freedos after all!)
  779. - XKEYB_PI.PAS, LISTXDEF.PAS and KEYMAN.PAS available in the source package
  780.  
  781.  
  782. Version 1.6:  (English version only)
  783.  
  784. - xKEYB looks now for .KEY files through path
  785. - DVORAK, RU layout added, IT corrected
  786.  
  787. Version 1.7:
  788.  
  789. - LED support completely removed (seems to give better results)
  790. - Improved search of .KEY files (also in current dir)
  791. - Added help (/?), changed the startup description lines
  792. - XKEYBRES now included inside XKEYB.PAS (using defines)
  793. - Reported values of BX/CX with int2Fh, AX=AD80h are switched
  794.   (to improve MS KEYB compatibility)
  795. - There is now a makefile to build the sources
  796. - Most of the messages are now displayed in English
  797. - Added br850.key (for Brazil, codepage 850)
  798.  
  799. Version 1.8:
  800.  
  801. - It now supports up to 127 scancodes
  802. - Fixed the problem with the two keys reporting scancode 53. The .KEY
  803.   files have been patched to support this
  804. - The Extended (E0h) keys no longer behave as those of the numpad
  805.   with respect to NumLock and SHIFT
  806. - Comments on the source file translated into English
  807. - SCANKBD is not more command-line friendly, and the RTE200 is
  808.   patched within the makefile
  809. - Contributed: PC860 (Standard, 860 codepage)
  810. - Modified: BR850, PC850, SP, LA
  811. - Removed: PC8, RU, ECMA
  812.  
  813.  
  814. Version 1.9:
  815.  
  816. - Fixed the bug with Alt+9 key combination
  817. - Added comments with ; inside the code
  818. - Control is passed to the next handler of the 2Fh chain for ALL the
  819.   non-supported functions, namely 83..8F, 92, 93, 9D..FF
  820. - All layouts now support [INS 0] (scancode 82)
  821. - Modified: PC860, BE
  822. - Added: RU, HU, US-LV, PL, TR
  823.  
  824.  
  825. 11. Use conditions
  826. ==================
  827.  
  828. Xkeyb is placed under the 'GNU general public license'.See the file
  829. 'copying.txt' for more information.
  830.  
  831. (C) Dietmar Hohmann, mailto:d.hoehmann@gmx.net 
  832. (C) Versions 1.51-1.9:
  833.     Aitor Santamaría Merino
  834.     (aitor.sm@terra.es)
  835.  
  836.              
  837. 12. XKeyb Files
  838. ===============
  839.  
  840. XKEYB.EXE    keyboard driver XKeyb
  841. XKEYB        Manual page for XKEYB
  842. XKEYB.TXT    this documentation as ASCII text
  843. *.KEY        definition files for all countries included with KEYB.COM
  844.              (29 files)
  845. XKEYBRES.EXE small keyboard driver to be loaded high
  846. KEYMAN.EXE   macro recorder KeyMan
  847. KEYMAN       Manual page for KeyMan
  848. LISTXDEF.EXE program to output the current XKeyb key assignment in
  849.              configuration file format
  850. LISTXDEF     Manual page for LISTXDEF
  851. SCANKBD.EXE  Program for scanning current keyboard layout
  852. copying.txt  GNU public license 
  853. KEYB.BAT     Add this to your C:\DOS or C:\DOS\BIN directory for emulating
  854.              Microsoft's KEYB
  855.  
  856.  
  857. 13.  Keyboard layout supported
  858. ==============================
  859. BE      Belgium
  860. BR850    Brazil (codepage 850)
  861. CF      Canada (French)
  862. DK      Denmark
  863. DVORAK  Dvorak type keyboard
  864. FR      France
  865. GR      Germany
  866. GR2     Germany II
  867. HU    Hungary
  868. IT      Italy
  869. LA      Latin America
  870. LDVORAK Left-handed Dvorak keyboard
  871. NL      Netherlands
  872. NO      Norway
  873. PC850   (PC/US standard, codepage 850)
  874. PC860   (PC/US standard, codepage 860)
  875. PL      Poland
  876. PO      Portugal
  877. RDVORAK Right-handed Dvorak keyboard
  878. RU      Russia
  879. SF      Switzerland (French)
  880. SG      Switzerland (German)
  881. SP      Spain
  882. SU      Finland
  883. SV      Sweden
  884. TR      Turkey
  885. UK      United Kingdom
  886. US      United States (PC standard, codepage 437)
  887. US-LV   US-style keyboard for Latvia
  888.